from django.conf.urls import url
from django.contrib import admin
from . import views
urlpatterns = [

    # 此路由用来查询省
    url(r'^areas/$', views.AreasView.as_view()),

    # 此路由用来查询市,正则取id值id不能作为命名参数,必须使用pk
    # 匹配出来的数据是字典格式{'pk':1} ,这个值传给了kwargs
    url(r'^areas/(?P<pk>\d+)/$',views.AreaView.as_view()),
    url(r'^addresses/$', views.AddressView.as_view()),
    url(r'^addresses/(?P<pk>\d+)/$', views.AddressView.as_view()),

]
